package com.lx.service.impl;

import com.lx.dao.SysUserMapper;
import com.lx.pojo.SysUser;
import com.lx.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public List<SysUser> getList(SysUser sysUser) {
        return sysUserMapper.selectSysUserList(sysUser);
    }

    @Override
    public int addUser(SysUser sysUser) {
        int result = sysUserMapper.add(sysUser);
        int a = 1/0;
        return result;
    }


    @Override
    public void updateDd(SysUser sysUser) {
        addUser(sysUser);
    }

}
